/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Mobile;

/**
 *
 * @author Javinel
 */
public class ThreadSendRACH implements Runnable {
    private Mobile mobile;
    

    public Mobile getMobile() {
        return mobile;
    }

    public void setMobile(Mobile mobile) {
        this.mobile = mobile;
    }

    @Override
    public void run() {
        while(true){
            if(mobile.getSlotNumber()==-1 && mobile.getStateMobile()==1){
                System.out.println("RACH send - mobile "+mobile.getId());  
                mobile.sendRACH();
            }
            try{
              System.out.println("Attente 10 secondes - mobile "+mobile.getId());  
              Thread.sleep(10000);  
            }
            catch(InterruptedException e){
                e.printStackTrace();
            }
        }
    }
    
    public ThreadSendRACH(Mobile m){
        this.mobile=m;
    }
    
}
